package com.study.demo.aop.demo5;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * @author: elvin
 * @time: 2019-08-15 16:00
 * @desc:
 **/
@Component
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        System.out.println("3.当前容器中注册的bean个数: " + beanFactory.getBeanDefinitionCount());
        System.out.println(String.join("," , beanFactory.getBeanDefinitionNames()));
    }
}
